package com.tjbklx1.redis.chap06;

import java.util.ArrayList;
import java.util.List;

public class TestCallback implements Callback {
	private int index;
	public List<Integer> counts = new ArrayList<Integer>();

	public void callback(String line) {
		if (line == null) {
			index++;
			return;
		}
		while (counts.size() == index) {
			counts.add(0);
		}
		counts.set(index, counts.get(index) + 1);
	}
}